package com.ai.module.user.domain.vo;

import com.ai.module.chat.util.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author: MrHe
 * @create: 2023-09-02 12:03
 * @description:
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("用户信息")
public class UserLoginInfo implements Serializable {
    //用户Id
    @ApiModelProperty("用户ID")
    private int id ;

    @ApiModelProperty("用户名")
    private String name;

    @ApiModelProperty("用户登录时间")
    private String loginTime;

    @ApiModelProperty("用户userId")
    private String uuid;

    @ApiModelProperty("用户登录token,用于请求头token")
    private String loginToken;

    @ApiModelProperty("用户头像地址")
    private String icon;

    @ApiModelProperty("用户慢图余额")
    private Integer slowDraw;

    @ApiModelProperty("用户快图余额")
    private Integer highDraw;

    @ApiModelProperty("用户chatgpt剩余token数")
    private Integer token;

    @ApiModelProperty("用户积分余额")
    private Integer points ;

    @ApiModelProperty("用户积分余额")
    private Integer realPoints ;

    @ApiModelProperty("用户是否签订积分自动兑换协议")
    private int pointsProtocol;

    @ApiModelProperty("用户邀请码")
    private String inviteCode;

    @ApiModelProperty("是否是VIP")
    private Integer vip = 1;

    @ApiModelProperty("vip过期时间")
    private String vipExpire ;

    public String getTaskImageUrl(Integer robotId, String fileType) {
        return String.format("%s/%s/%s", fileType, this.id, robotId);
    }

    public String getTaskImageUrl(String fileType) {
        return String.format("%s/%s", fileType, this.id);
    }

    public String getTaskImageUrl(String fileType, String robotId) {
        return String.format("%s/%s/%s/%s", fileType, this.id,robotId, DateUtils.getTransDateTime());
    }
    public String getTaskImageUrl(String fatherFile,String fileType, String robotId) {
        return String.format("%s/%s/%s/%s/%s",fatherFile, fileType, this.id,robotId, DateUtils.getTransDateTime());
    }

}
